\testfile{pgfplotstest.plottypes.tex}
\testsection{Stacked plots}
%\pgfplotsset{every axis/.append style={reverse stacked plots=false}}
\testsubsection{stack y, sharp plot}
\starttikzpicture
%\tracingmacros=2\tracingcommands=2
	\startaxis[stack plots=y,
		legend style={at={(0.03,0.97)},anchor=north west}
	]
	\addplot coordinates {(0,0) (1,1) (2,1) (3,2)};
	\addplot coordinates {(0,0) (1,1) (2,1) (3,2)};
	\addplot coordinates {(0,0) (1,1) (2,1) (3,2)};
	\legend{1,2,3}
	\stopaxis
%\tracingmacros=0\tracingcommands=0
\stoptikzpicture

\testsubsubsection{with closedcycle}
\begingroup
\def\example#1{%
\starttikzpicture
	\startaxis[stack plots=y,
		legend style={at={(0.03,0.97)},anchor=north west}
	]
	\addplot+[#1] coordinates {(0,0) (1,1) (2,1) (3,2)} \closedcycle;
	\addplot+[#1] coordinates {(0,0) (1,1) (2,1) (3,2)} \closedcycle;
	\addplot+[#1] coordinates {(0,0) (1,1) (2,1) (3,2)} \closedcycle;
	\legend{1,2,3}
	\stopaxis
\stoptikzpicture
}

\example{}

\example{fill}
\endgroup

\testsubsubsection{with closedcycle and const plots}
\begingroup
\def\example#1{%
\starttikzpicture[#1]
	\startaxis[stack plots=y,
		legend style={at={(0.03,0.97)},anchor=north west}
	]
	\addplot+[fill] coordinates {(0,0.5) (1,1) (2,1) (3,2) (4,2)}  \closedcycle;
	\addplot+[fill] coordinates {(0,0.5) (1,1) (2,1) (3,2) (4,2)} \closedcycle;
	\addplot+[fill] coordinates {(0,0.5) (1,1) (2,1) (3,2) (4,2)} \closedcycle;
	\legend{1,2,3}
	\stopaxis
\stoptikzpicture
}

\example{const plot mark left}

\example{const plot mark right}
\endgroup

\testsubsection{stack y, ybar}
\starttikzpicture
	\startaxis[
		ybar stacked,
		legend style={at={(0.03,0.97)},anchor=north west},
	]
	\addplot coordinates {(0,0) (1,1) (2,1) (3,2)};
	\addplot coordinates {(0,0) (1,1) (2,1) (3,2)};
	\addplot coordinates {(0,0) (1,1) (2,1) (3,2)};
	\legend{1,2,3}
	\stopaxis
\stoptikzpicture

\testsubsection{stack y, ybar, minus}
\starttikzpicture
	\startaxis[
		ybar stacked=minus,
	]
	\addplot coordinates {(0,0) (1,1) (2,1) (3,2)};
	\addplot coordinates {(0,0) (1,1) (2,1) (3,2)};
	\addplot coordinates {(0,0) (1,1) (2,1) (3,2)};
	\legend{1,2,3}
	\stopaxis
\stoptikzpicture

\testsubsection{stack x, sharp plot [not useful]}
\starttikzpicture
%\tracingmacros=2\tracingcommands=2
	\startaxis[stack plots=x,
		legend style={at={(0.97,0.03)},anchor=south east},
		xtick={0,...,30},
	]
	\addplot coordinates {(2,0) (1,1) (1,2) (3,3)};
	\addplot coordinates {(2,0) (1,1) (1,2) (3,3)};
	\addplot coordinates {(2,0) (1,1) (1,2) (3,3)};
	\legend{1,2,3}
	\stopaxis
%\tracingmacros=0\tracingcommands=0
\stoptikzpicture

\testsubsection{stack x, xbar}
\starttikzpicture
	\startaxis[
		xbar stacked,
		xtick={0,...,30},
		legend style={at={(0.97,0.03)},anchor=south east},
	]
	\addplot coordinates {(2,0) (1,1) (1,2) (3,3)};
	\addplot coordinates {(2,0) (1,1) (1,2) (3,3)};
	\addplot coordinates {(2,0) (1,1) (1,2) (3,3)};
	\legend{1,2,3}
	\stopaxis
\stoptikzpicture

\testsubsection{stack x, xbar, minus}
\starttikzpicture
	\startaxis[xbar stacked=minus]
	\addplot coordinates {(2,0) (1,1) (1,2) (3,3)};
	\addplot coordinates {(2,0) (1,1) (1,2) (3,3)};
	\addplot coordinates {(2,0) (1,1) (1,2) (3,3)};
	\legend{1,2,3}
	\stopaxis
\stoptikzpicture

\testsection{Bar diagrams}
{
\starttikzpicture
	\startaxis[
		%xmin=1925,xmax=1975,disabledatascaling=false,
		%xtick={1930,1940,1950,1960,1970},
		x tick label style={/pgf/number format/set thousands separator=},
		ylabel=Population,
		enlargelimits=0.15,
		legend style={at={(0.5,-0.1)},anchor=north,legend columns=-1},
		ybar,
	]
%\tracingmacros=2\tracingcommands=2
	\addplot[draw=blue,mark=none,fill=blue!80!black]
		plot coordinates {(1930,50e6) (1940,33e6) (1950,40e6) (1960,50e6) (1970,70e6)};
	\addlegendentry{FarFarAway}

	\addplot[mark=none,red,fill=red!80!black]
		plot coordinates {(1930,38e6) (1940,42e6) (1950,43e6) (1960,45e6) (1970,65e6)};
	\addlegendentry{NotSoFar}

	\addplot[mark=none,blue,fill=blue!80!black]
		plot coordinates {(1930,15e6) (1940,12e6) (1950,13e6) (1960,25e6) (1970,35e6)};
	\addlegendentry{Near}
	\stopaxis
\stoptikzpicture

\testsubsection{Interval bar handlers}
\starttikzpicture
	\startaxis[
		x tick label style={/pgf/number format/set thousands separator=},
		ylabel=Population,
		enlargelimits=0.05,
		legend style={at={(0.5,-0.1)},anchor=north,legend columns=-1},
		ybar interval=0.7,
	]
	\addplot[draw=blue,mark=none,fill=blue!80!black]
		plot coordinates {(1930,50e6) (1940,33e6) (1950,40e6) (1960,50e6) (1970,70e6) (1980,70e6)};
	\addlegendentry{FarFarAway}

	\addplot[mark=none,red,fill=red!80!black]
		plot coordinates {(1930,38e6) (1940,42e6) (1950,43e6) (1960,45e6) (1970,65e6) (1980,70e6)};
	\addlegendentry{NotSoFar}

	\addplot[mark=none,blue,fill=blue!80!black]
		plot coordinates {(1930,15e6) (1940,12e6) (1950,13e6) (1960,25e6) (1970,35e6) (1980,70e6)};
	\addlegendentry{Near}
	\stopaxis
\stoptikzpicture

\starttikzpicture
	\startaxis[
	xmin=0,xmax=53,
		ylabel=Age,
		xlabel=Quantity,
		y label style={yshift=0.7cm},
		enlargelimits=false,
		ytick={5,10,13,18,21,25,30,50,70},
		yticklabel={$\pgfmathprintnumber{\tick}$ -- $\pgfmathprintnumber{\nexttick}$},
		xbar interval,
	]
	\addplot[draw=blue,mark=none,fill=blue!80!black]
		plot coordinates {(10,5) (10.5,10) (15,13) (24,18) (50,21) (23,25) (10,30) (3,50) (3,70)};
	\stopaxis
\stoptikzpicture


\testsection{const plot}
\starttikzpicture
	\startaxis
	\addplot+[const plot]
		coordinates {(0,0.1) (0.1,0.2) (0.2,0.2) (0.3,0.5) (0.4,0.45) (0.5,1) (0.6,1) (0.7,0.1) (0.8,0.15) (0.9,0.2) (1,0.2)};
	\stopaxis
\stoptikzpicture

\testsection{const plot mark right}
\starttikzpicture
	\startaxis
	\addplot+[const plot mark right]
		coordinates {(0,0.1) (0.1,0.2) (0.2,0.2) (0.3,0.5) (0.4,0.45) (0.5,1) (0.6,1) (0.7,0.1) (0.8,0.15) (0.9,0.2) (1,0.2)};
	\stopaxis
\stoptikzpicture

\testsection{jump mark right}
\starttikzpicture
	\startaxis
	\addplot+[jump mark right]
		coordinates {(0,0.1) (0.1,0.2) (0.2,0.2) (0.3,0.5) (0.4,0.45) (0.5,1) (0.6,1) (0.7,0.1) (0.8,0.15) (0.9,0.2) (1,0.2)};
	\stopaxis
\stoptikzpicture

\testsection{jump mark left}
\starttikzpicture
	\startaxis
	\addplot+[jump mark left]
		coordinates {(0,0.1) (0.1,0.2) (0.2,0.2) (0.3,0.5) (0.4,0.45) (0.5,1) (0.6,1) (0.7,0.1) (0.8,0.15) (0.9,0.2) (1,0.2)};
	\stopaxis
\stoptikzpicture

\starttikzpicture
\startaxis[
]
\addplot3[patch,
    patch type=biquadratic,
    shader=interp]
coordinates {
    (0,0,1) (6,1,0) (5,5,0) (-1,5,0)
    (3,1,0) (6,3,0) (2,6,0) (0,3,0)
    (3,3.75,0)
};
\stopaxis
\stoptikzpicture% <- eliminate space
